package com.xingkeduo.pojo.json.cms;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.xingkeduo.pojo.dto.Manager.ManagerDTO;
import com.xingkeduo.util.pojo.base.BaseJson;


public class CManagerJson extends BaseJson {


	public static ObjectNode toJson(ManagerDTO managerDTO) {
		ObjectNode root = MAPPER.createObjectNode();

		if (managerDTO != null)
		{
			root.put("id", managerDTO.getId());
			root.put("name", managerDTO.getName());
			root.put("phone", managerDTO.getPhone());
			root.put("deptmentId", managerDTO.getDeptmentId());
			root.put("deptmentName", managerDTO.getDeptmentName());
			root.put("postsId", managerDTO.getPostsId());
			root.put("postsName", managerDTO.getPostsName());
			root.put("status", managerDTO.getStatus());

			String permsList = JSON.toJSONString(managerDTO.getManagerPermsDTOList());
			root.put("permsList",permsList);
		}

		return root;
	}

}
